def make_change(coins, amount):
    coins.sort()
    history = dict()

    mn = min(coins)

    history[min] = {min: 1}

    for i in range(1, mn):
        history[i] = None

    for value in range(mn + 1, amount + 1):
        history[value] = dict()
        prev = None
        for coin in coins:
            if value >= coin:
                prev = coin
        if not prev:
            raise ValueError("Can't make change with these coins")

        num_times = value // prev

        history[value][prev] = num_times
        already_calc = value - (num_times * prev)
        if already_calc in history:
            history[value].update(history[already_calc])

    return repr(history[amount])

if __name__ == '__main__':
    print(make_change([25,5,10,1], 119))
